import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import os
def poly(pd_iris):
    plt.figure(dpi=110)
    sns.set(style="whitegrid", font_scale=1.2)

    g = sns.regplot(x='ASU', y='Topsis', data=pd_iris,
                    marker='.',
                    order=4,  # 默认为1，越大越弯曲
                    scatter_kws={'s': 60, 'color': '#016392', },  # 设置散点属性，参考plt.scatter
                    line_kws={'linestyle': '--', 'color': '#c72e29'}  # 设置线属性，参考 plt.plot

                    )
    plt.show()

if __name__ == '__main__':
    if os.path.exists('dim_4_data'):
        # 导入数据表格
        df = pd.read_csv("dim_4_data/PG_4Dim_3DBin_actual20230422155605.csv")
        # print(df.head())
        df2 = df[df.columns[1:6]]
        #print(df2[df2.columns[1]])
        len = df2['ASU'].shape[0]
        #print(range(0, len))
        df2['index'] = range(0, len)
        df2['ASU'] = df2['ASU'].astype('float64')
        df2['MSSE'] = df2['MSSE'].astype('float64')
        df2['Loss'] = df2['Loss'].astype('float64')
        df2['Rewards'] = df2['Rewards'].astype('float64')
        df2['Topsis'] = df2['Topsis'].astype('float64')

        # print(df2.head())
        poly(df2)